<%--
  Created by IntelliJ IDEA.
  User: haol
  Date: 2016/9/4
  Time: 16:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%@ include file="/common/meta.jsp" %>
</head>
<body class="bady_login">
<div class="container" id="login">
    <form action="${ctx}/user/login" id="loginform" method="post">
        <div class="panel panel-default" style="height: 300px">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <p class="text-center">小区管理系统V1.0</p>
            </div>
            <div class="panel-body">
                <p class="lead">
                <div class="input-group">
                    <div class="input-group-addon">用户名</div>
                    <input class="form-control" placeholder="UserName" name="username">
                </div>
                </p>
                <p class="lead">
                <div class="input-group">
                    <div class="input-group-addon">密&nbsp;&nbsp;&nbsp;&nbsp;码</div>
                    <input class="form-control" placeholder="Password" name="password" type="password">
                </div>
                </p>
                <p>&nbsp;</p>
                <p class="text-center">
                        <button class="btn btn-success" type="button" id="loginbutton">登陆</button>
                <p class="bg-warning"><span style="color: red"> ${error} </span></p>

                </p>
                <p class="text-center">
                    <span>业主请使用系统业主号登录</span><br>
                    <span>账号owner|密码gcu</span></p>
            </div>
            <div class="panel-body">
                <p class="text-center">@好好de浩浩</p>
            </div>
        </div>
            <!-- Table -->
    </form>
</div>
</body>
<script type="text/javascript">
    $(function () {
        $("#loginbutton").click(function () {
            var inputName = $("input[name=username]").val();
            var inputPwd = $("input[name=password]").val();
            var checkName = /^[a-zA-Z]{1}([a-zA-Z0-9]| [._]){1,10}/;
            if (!checkName.exec(inputName)) {
                art.dialog.tips("用户名以字母开头!");
                return false;
            }
            else if (inputPwd == null || inputPwd == "") {
                art.dialog.tips("密码不能为空!");
                return false;
            } else {
                $("#loginform").submit();
                /*document.getElementById("loginform").submit;*/
            }
        });
    });
</script>

</html>
